<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : NDepend Task</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : NDepend Task
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Jun 26, 2009 by <font color="#0050B2">csut017</font>.
				    </div>

				    <h3><a name="NDependTask-NDependTask"></a>NDepend Task</h3>

<p>Runs an NDepend analysis.</p>

<blockquote>
<p>NDepend is a tool that simplifies managing a complex .NET code base. Architects and developers can analyze code structure, specify design rules, plan massive refactoring, do effective code reviews and master evolution by comparing different versions of the code.</p></blockquote>

<p>This application is available from <a href="http://www.ndepend.com/">www.ndepend.com</a>. There is both an open source/academic/evaluation version and a professional version.</p>

<h3><a name="NDependTask-Version"></a>Version</h3>

<p>This publisher is available from version 1.4.4.</p>

<h3><a name="NDependTask-Examples"></a>Examples</h3>

<p>Minimalist Example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;ndepend&gt;</span>
  <span class="code-tag">&lt;project&gt;</span>NDepend-Project.xml<span class="code-tag">&lt;/project&gt;</span>
<span class="code-tag">&lt;/ndepend&gt;</span></pre>
</div></div>
<p>Full example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;ndepend&gt;</span>
  <span class="code-tag">&lt;project&gt;</span>NDepend-Project.xml<span class="code-tag">&lt;/project&gt;</span>
  <span class="code-tag">&lt;executable&gt;</span>tools\NDepend.Console.exe<span class="code-tag">&lt;/executable&gt;</span>
  <span class="code-tag">&lt;description&gt;</span>Run the NDepend analysis.<span class="code-tag">&lt;/description&gt;</span>
  <span class="code-tag">&lt;emitXml&gt;</span>true<span class="code-tag">&lt;/emitXml&gt;</span>
  <span class="code-tag">&lt;outputDir&gt;</span>NDepend-Reports<span class="code-tag">&lt;/outputDir&gt;</span>
  <span class="code-tag">&lt;inputDirs&gt;</span>
    <span class="code-tag">&lt;inputDir&gt;</span>bin\<span class="code-tag">&lt;/inputDir&gt;</span>
    <span class="code-tag">&lt;inputDir&gt;</span>deploy\<span class="code-tag">&lt;/inputDir&gt;</span>
  <span class="code-tag">&lt;/inputDirs&gt;</span>
  <span class="code-tag">&lt;silent&gt;</span>false<span class="code-tag">&lt;/silent&gt;</span>
  <span class="code-tag">&lt;reportXslt&gt;</span>custom-report.xsl<span class="code-tag">&lt;/reportXslt&gt;</span>
  <span class="code-tag">&lt;timeout&gt;</span>120<span class="code-tag">&lt;/timeout&gt;</span>
  <span class="code-tag">&lt;baseDir&gt;</span>project\<span class="code-tag">&lt;/baseDir&gt;</span>
  <span class="code-tag">&lt;publish&gt;</span>true<span class="code-tag">&lt;/publish&gt;</span>
<span class="code-tag">&lt;/ndepend&gt;</span></pre>
</div></div>

<h3><a name="NDependTask-ConfigurationElements%3A"></a>Configuration Elements:</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Node </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Version </th>
</tr>
<tr>
<td class='confluenceTd'> project </td>
<td class='confluenceTd'> The NDepend project file. This is generated from VisualNDepend. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> Yes </td>
<td class='confluenceTd'> <em>N/A</em> </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> executable </td>
<td class='confluenceTd'> The executable to use. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> NDepend.Console </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> description </td>
<td class='confluenceTd'> Description used for the visualisation of the buildstage, if left empty the process name will be shown. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> emitXml </td>
<td class='confluenceTd'> Whether to emit the XML report data or not. </td>
<td class='confluenceTd'> boolean </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> outputDir </td>
<td class='confluenceTd'> The output directory to use. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> NDependResults </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> inputDirs </td>
<td class='confluenceTd'> The input directories to use. </td>
<td class='confluenceTd'> array of string </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> silent </td>
<td class='confluenceTd'> Whether to hide any output or not. </td>
<td class='confluenceTd'> boolean </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> reportXslt </td>
<td class='confluenceTd'> The location of a custom report XSL-T. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> timeout </td>
<td class='confluenceTd'> The time-out period in seconds. </td>
<td class='confluenceTd'> int </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> 600 </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> baseDir </td>
<td class='confluenceTd'> The base directory to use. If omitted this will default to the working directory of the project. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> publish </td>
<td class='confluenceTd'> Whether to publish the output files or not. </td>
<td class='confluenceTd'> boolean </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> true </td>
<td class='confluenceTd'> 1.4.4 </td>
</tr>
<tr>
<td class='confluenceTd'> dynamicValues </td>
<td class='confluenceTd'> Any dynamic parameters to be used. See <a href="Dynamic Parameters.html" title="Dynamic Parameters">Dynamic Parameters</a> </td>
<td class='confluenceTd'> Dynamic values array - see <a href="Dynamic Parameters.html" title="Dynamic Parameters">Dynamic Parameters</a> </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
</tbody></table>
<p><em><b>Note:</b> Most of these parameters are passed onto the NDepend executable. Further details on these passed parameters is available at <a href="http://www.ndepend.com/NDependConsole.aspx">http://www.ndepend.com/NDependConsole.aspx</a>.</em></p>

<h3><a name="NDependTask-Notes"></a>Notes</h3>

<p>This task works in two stages:</p>
<ol>
	<li>Run the NDepend executable</li>
	<li>Publish the results</li>
</ol>


<p>Running the NDepend executable is what generates the actual analysis, and as such cannot be skipped (otherwise there is no point to this task.) The results of the analysis will be saved in the folder specified by <em>outputDir</em>. If this parameter is omitted, then the results will be stored in a folder called NDependResults under the <em>baseDir</em>.</p>

<p>In order for these results to be displayed in the dashboard they must be stored in a folder in the artefacts directory. To achieve this, this task will publish the results. This involves copying all the results files from the output directory to a folder in the artefacts directory. This folder will have the same name as the build label. Additionally any XML files will be merged with the build log (this makes them available for the dashboard plugins).</p>

<p>If the publishing behaviour is not required it can be turned off by setting the <em>publish</em> property to false. By default this is set to true so the results can be displayed in the dashboard.</p>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>